/*!
\file MainWindow.h
\brief Contains definition of MainWindow class.
\ingroup GUI
*/

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include<QMainWindow>
#include<QMenu>
#include<QMenuBar>
#include<QList>
#include<QAction>
#include<QFileDialog>

#include"Visualizer.h"
#include"AlgorithmInterface.h"
#include"DManager.h"
#include"GraphConfirmationDialog.h"
#include"GraphAlgorithmCombination.h"
#include"XmlHandler.h"

/*!
\defgroup GUI GUI module
This group consists of (almost) all GUI related code.
*/

/*!
\class MainWindow
\brief Main application window.
This GUI element is responsible for storing the Algorithm plugins that were loaded in main. It allows the user to select those, and select Graphs, and will add such combinations to Visualizer if the user requests it.
\ingroup GUI
*/


class MainWindow: public QMainWindow{
	Q_OBJECT
public:
	MainWindow();
	//!< Constructor. This window is always on top.
	~MainWindow();
	//!< Destructor.
	
	void addAlgorithm( Algorithm *a );
	//!< Will cause Algorithm a to be visualized.
	void addAlgorithm( AlgorithmInterface *a );
	//!< Adds Algorithm created by AlgorithmInterface to the list of available Algorithms.
private:
	Visualizer *m_visualizer;
	QMenu *m_algorithmMenu;
	QMenu *m_graphMenu;
	GraphAlgorithmCombination *m_combination;
	Graph *m_lastSelectedGraph;
	
	QList<AlgorithmInterface*> m_algorithmInterfaces;
	QList<QAction*> m_algorithmActions;
private slots:
	void algorithmTriggered();
	void graphTriggered();
	void combinationTriggered();
};

#endif
